1. Field of the Invention
The present invention relates to a three-dimensional display apparatus suitable for approximating a three-dimensional object by means of a set of planes within a three-dimensional space, approximating each plane by way of a set of scan lines, executing a shading process for each scan line and displaying the three-dimensional object on a two-dimensional display.
2. Description of the Related Art
In a computer system, a graphic processing technique for displaying a three-dimensional object on a raster scan color display monitor has a great importance. Basically, a graphic processing progresses as follows:
(1) Using Computer Aided Design (CAD), a surface of a three-dimensional object is approximated by a set of triangles in a three-dimensional space (see FIG. 1). Methods for approximating a three-dimensional object using trapezoids or rectangles as well as a set of triangles are known. (2) Coordinates and luminance values of vertexes of each triangle are determined. (3) Coordinates and luminance values of intersections Pai and Pbi of a given scan line and two sides of each triangle are calculated, as shown in FIG. 2. Coordinates and luminance values of pixels on the scan line connecting intersections Pai and Pbi are calculated, and the luminance values displayed on a display monitor.
FIG. 3 shows an arrangement of a conventional three-dimensional display apparatus. FIG. 3 is substantially the same as FIG. 2A of U.S. Pat. No. 4,475,104, which is incorporated thus in present specification, along with the associated explanation given in the above-mentioned U.S. Patent.
The aforementioned processing (3) is performed as follows in the three-dimensional display apparatus shown in FIG. 3:
A controller 11 receives, from a data base (not shown), vertex information (coordinates and luminance values) of each of n triangles approximating a three-dimensional object. For ease of understanding, assume that what controller 11 receives are the coordinates and luminance values of vertexes P1, P2, and P3 of a triangle shown in FIG. 2. On the basis of the vertex information received, controller 11 then calculates increments (unit increments) .DELTA.xa, .DELTA.za, and .DELTA.Ia of parameters x, z, and I for side Ea, when y is increased by one (unit length), and, similarly, unit increments .DELTA.xb, .DELTA.zb, and .DELTA.Ib of parameters x, z, and I for side Eb.
Next, controller 11 sets the x- and y-coordinates x1, y1 of vertex P1 in an X-Y coordinate generator 12, and, at the same time, sets a z-coordinate z1 and a luminance I1 of vertex P1 in a X coordinate generator 13 and a luminance generator 14, respectively.
Thereafter, controller 11 drives generators 12-14 and outputs a write-enable signal 15 to AND gate 19. These three generators, 12-14, generate approximate coordinates and luminance values of the individual pixels on each of the scan lines, from the scan line (first scan line) passing vertex P1 to the one ((y2-y1+1)-th scan line) passing vertex P2, as follows.
There is only one pixel on the first scan line at point P1. X-Y coordinate generator 12 generates x- and y-coordinates x1, y1, Z coordinate generator 13 generates coordinate z1, and luminance generator 14 generates luminance value I1.
A Z memory 16 stores z-coordinates for the individual pixels. When memory 16 is addressed by x- and y-coordinates from generator 12, a z-coordinate at the designated address position is read out therefrom and is compared, by a comparator 17, with a z-coordinate generated by Z coordinate generator 13.
When the coordinate from the latter is smaller than that from the former, comparator 17 sets a write-enable signal 18 at logic "0." In response to this signal an AND gate 19 sets its output signal, write signal 21, at logic "0" irrespective of write-enable signal 15. As a result, the z-coordinate in Z memory 16 and luminance value I in a luminance memory 20 are left unchanged.
On the other hand, when the z-coordinate from generator 13 is larger than the one read out from Z memory 16, comparator 17 outputs write enable signal 18 of logic "1" to AND gate 19. In response to this signal 18, AND gate 19 outputs signal 21 of level "1" to Z memory 16 and luminance memory 20. Upon receipt of signal 21, Z memory 16 stores a new z-coordinate (z1) generated from generator 13 in a storage area designated by x- and y-coordinates from generator 12. Similarly, luminance memory 20 stores a new luminance value I (I1) generated by luminance generator 14 in a storage area designated by x- and y-coordinates from generator 12. The above completes the process for the first scan line.
The following processing is executed for those scan lines after the second line:
Given that the target scan line is the i-th scan line, the coordinates and luminance value of intersection Pai (the left end of the i-th scan line) between the i-th scan line and side Ea are acquired first. Then, the coordinates and luminance value of intersection Pbi (the right end of the i-th scan line) between the i-th scan line and side Eb are acquired. Based on the acquired coordinates and luminance values of both end points (Pai, Pbi), X-Y coordinate generator 12 sequentially generates x- and y-coordinates xij, yij from the first pixel. Similarly, Z coordinate generator 13 generates z-coordinates zij, and luminance generator 14 generates luminance values Iij. As a result, z-coordinate in Z memory 16 and the luminance value in luminance memory 20 are updated with respect to the j-th pixel on the i-th scan line, as is the case of vertex P1.
Then, the x-coordinate is incremented by one. And, the coordinates and luminance value for the next pixel indicated by j=j+1 are generated and the z-coordinate and luminance value in memories 16 and 20 are updated. When the updation is executed for intersection Pbi, shading for the i-th scan line is completed.
Shading is executed for the next scan line indicated by yi=yi+1 in the aforementioned procedures.
The above operations are repeated. Upon completion of shading for the scan line passing vertex P2, shading of a lower triangle (.DELTA.P1P2P4) in FIG. 2 is completed. Then, an upper triangle (.DELTA.P2P3P4) is also shaded in the same manner as the lower triangle. Consequently, z-coordinates and luminance values of the individual pixels in the triangle (.DELTA.P1P2P3) are updated in memories 16 and 20. The contents of luminance memory 20 are read out onto a CRT monitor 23 by a display timing circuit 22.
The aforementioned three-dimensional object is generally expressed by a significant number of pixels ranging between one million to ten millions. Therefore, calculation of three-dimensional coordinates and luminance values pixel by pixel as is done in the three-dimensional display apparatus shown in FIG. 3 is time-consuming for completion of an approximated image of a single object. In this respect, it is difficult to apply the conventional three-dimensional display apparatus to a field that requires high speed display, such as animation display.